# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=speedpwn
pkgver=8.3dd2793
pkgrel=6
groups=('blackarch' 'blackarch-cracker' 'blackarch-wireless')
pkgdesc='An active WPA/2 Bruteforcer, original created to prove weak standard key generation in different ISP labeled routers without a client is connected. '
arch=('x86_64' 'aarch64')
url='https://gitorious.org/speedpwn/'
license=('GPL2')
depends=('openssl' 'aircrack-ng' 'perl')
makedepends=('git')
source=("git+https://gitorious.org/speedpwn/$pkgname.git"
        'http://download.aircrack-ng.org/aircrack-ng-1.2-beta3.tar.gz')
sha512sums=('SKIP'
            'f6d17be10b8277f08d8867b4ced5a89f9de13cc59767958a6c617e583724d0baaafdda6c14ef3c1671cada2a5abdf885b49728910fb64d70a41ace9043b3e372')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

build() {
  cd "$srcdir/aircrack-ng-1.2-beta3/src/osdep"

  make

  cd ".."

  cp -a "$srcdir/speedpwn/"* "."

  gcc -o speedpwn speedpwn.c common.c osdep/libosdep.a crypto_branch.c \
    -lssl -lcrypto -I include/
}

package() {
  cd $pkgname

  install -Dm 755 "$srcdir/aircrack-ng-1.2-beta3/src/$pkgname" \
    "$pkgdir/usr/bin/$pkgname"
  install -Dm 755 speedport-arcadyan.pl "$pkgdir/usr/bin/speedport-arcadyan"
  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README
}

